home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: SPARCompiler error
- Date: 1 Feb 1996 00:13:25 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4ep0j5$ktd@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe7.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 31, 1996 15:21:34 in article <SPARCompiler error>,
- 'mkt@isun04.inf.uni-jena.de (Tilo Koerbs)' wrote:
-
-
- >The SPARCompiler 4.0x has a nice incompatibility between
- >C++ and ANSI-C 'optimized away'. The C++ compiler behaves
- >like an ANSI-C compiler here:
- >
- >cout << (1 ? 'a' : 'b') << endl;
- >
- >Question: What is the output on the screen?
- >In C++ it is an 'a'.
- >Not so the SPARCompiler. It prints out a '97'!!!
- >This is exactly what ANSI-C compiler do! They do an integral promotion
-
- Does an ANSI-C compiler really print out a '97'?? I would expect
- it to print something like:
- Error. Undeclared identifier: cout.
- Error. Undeclared identifier: endl;
- Syntax error. Binary shift....
-
- >on the second and third operand of ?:
- >C++ does no promotion.
- >Who can tell these SPARCompiler-Guys about the error?
- >
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-